<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select.apply(_self, arguments)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref="multipleTable" :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.emservice.main4_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type="selection" :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('servicecode')">
                <el-table-column show-overflow-tooltip :prop="'servicecode'" :label="$t('entities.emservice.main4_grid.columns.servicecode')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.servicecode')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.servicecode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('emservicename')">
                <el-table-column show-overflow-tooltip :prop="'emservicename'" :label="$t('entities.emservice.main4_grid.columns.emservicename')" :width="204"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.emservicename')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link
                            deKeyField="emservice"
                            :context="JSON.parse(JSON.stringify(context))"
                            :viewparams="JSON.parse(JSON.stringify(viewparams))"
                            :data="row"
                            :linkview="{viewname: 'emservice-tab-exp-view', height: 0,width: 0,title: $t('entities.emservice.views.tabexpview.title'),placement: '', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}"
                            valueitem="srfkey"
                        >
                            <span>{{row.emservicename}}</span>
                        </app-column-link>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('servicegroup')">
                <el-table-column show-overflow-tooltip :prop="'servicegroup'" :label="$t('entities.emservice.main4_grid.columns.servicegroup')" :width="180"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.servicegroup')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.servicegroup" tag="EMSERVICEGROUP" codelistType="STATIC" renderMode="NUM" textSeparator="、" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('sums')">
                <el-table-column show-overflow-tooltip :prop="'sums'" :label="$t('entities.emservice.main4_grid.columns.sums')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.sums')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.sums}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('zzyw')">
                <el-table-column show-overflow-tooltip :prop="'zzyw'" :label="$t('entities.emservice.main4_grid.columns.zzyw')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.zzyw')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.zzyw}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('labservicelevelid')">
                <el-table-column show-overflow-tooltip :prop="'labservicelevelid'" :label="$t('entities.emservice.main4_grid.columns.labservicelevelid')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.labservicelevelid')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.labservicelevelid" tag="EMSERVICELEVEL" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('servicestate')">
                <el-table-column show-overflow-tooltip :prop="'servicestate'" :label="$t('entities.emservice.main4_grid.columns.servicestate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.servicestate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.servicestate" tag="EMSERVICESTATE" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('prman')">
                <el-table-column show-overflow-tooltip :prop="'prman'" :label="$t('entities.emservice.main4_grid.columns.prman')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.prman')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.prman}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('tel')">
                <el-table-column show-overflow-tooltip :prop="'tel'" :label="$t('entities.emservice.main4_grid.columns.tel')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.tel')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.tel}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('fax')">
                <el-table-column show-overflow-tooltip :prop="'fax'" :label="$t('entities.emservice.main4_grid.columns.fax')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.fax')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.fax}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('zip')">
                <el-table-column show-overflow-tooltip :prop="'zip'" :label="$t('entities.emservice.main4_grid.columns.zip')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.zip')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.zip}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('addr')">
                <el-table-column show-overflow-tooltip :prop="'addr'" :label="$t('entities.emservice.main4_grid.columns.addr')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.addr')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.addr}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('website')">
                <el-table-column show-overflow-tooltip :prop="'website'" :label="$t('entities.emservice.main4_grid.columns.website')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.website')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.website}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('accode')">
                <el-table-column show-overflow-tooltip :prop="'accode'" :label="$t('entities.emservice.main4_grid.columns.accode')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.accode')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.accode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('payway')">
                <el-table-column show-overflow-tooltip :prop="'payway'" :label="$t('entities.emservice.main4_grid.columns.payway')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.emservice.main4_grid.columns.payway')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.payway" tag="EMPAYWAY" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class="grid-pagination" v-show="items.length > 0">
            <page class="pull-right" @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>